   // 资源详情右侧的开发商切换
   if ($(".exhibitionlist .lubox .bd li").size() > 1) {
    var vis_=3;
    if($(".exhibitionlist .lubox").hasClass("theme")){
        vis_=5
    }
    jQuery(".exhibitionlist .lubox").slide({
        mainCell: ".bd ul",
        autoPage: "true",
        effect: "leftLoop",
        vis:vis_,
        startFun:function(i,c){
            $(window).trigger('scroll');
        }
    })
    resizeImg(" .exhibitionlist .lubox .bd li");
  }
   //图片放大切换效果
 function resizeImg(objname) {
    var obj = $(objname)
    var imgbox = obj.parents(".lubox");
    var imgarry = [];
    //存储图片
    var len = obj.length;
    var Img = imgbox.find('img');
    var realwd, realhd;
    var imgo = new Image();
    imgo.src = Img.eq(0).attr('src');
    imgo.onload = function() {
        for (var i = 0; i < len; i++) {
            realwd = imgo.width;
            realhd = imgo.height;
            var imgdx = new Object();
            imgdx.rWidth = realwd;
            imgdx.rHeight = realhd > parseInt($(window).height()) ? parseInt($(window).height()) : realhd;
            imgdx.imgsrc = Img.eq(i).attr('src');
            imgarry.push(imgdx);
        }
    }
    imgo.src = Img.eq(0).attr('src');
  
    obj.on("click", function() {
        var html = "";
        var str = "";
        var current = $(this).index();
        $.each(imgarry, function(n, v) {
            if (n == current) {
                str = "<img src='" + v.imgsrc + "' class='current'>"
            } else {
                str = "<img src='" + v.imgsrc + "'>"
            }
            html = html + str;
        })
        $('body > .bg').remove();
        $('body > .m-showbox').remove();
        $("body").append('<div class="bg"></div><div class="close-showbox"></div><div class="m-showbox"> <div class="inner-box"><span class="prev"></span> ' + html + '<span class="next"></span></div>');
        $(".bg").show();
        $("body").css("overflow", "hidden");
        $(".m-showbox").fadeIn();
        if (len < 2) {
            $(".prev,.next").hide()
        }
        function showCurrent(current) {
            $(".m-showbox").css({
                "margin-top": -imgarry[current].rHeight / 2,
                "margin-left": -imgarry[current].rWidth / 2,
                "height": imgarry[current].rHeight,
                "width": imgarry[current].rWidth
            });
            $(".m-showbox .inner-box").css({
                "height": imgarry[current].rHeight,
                "width": imgarry[current].rWidth
            });
        }
        showCurrent(current);
        //上一张
        $(".m-showbox .prev").on("click", function() {
            if (current == 0) {
                current = len - 1;
            } else {
                current = current - 1;
            }
            $(".m-showbox img").eq(current).addClass("current").siblings().removeClass("current");
            showCurrent(current);
        });
  
        //下一张
        $(".m-showbox .next").on("click", function() {
            if (current == len - 1) {
                current = 0;
            } else {
                current = current + 1;
            }
            $(".m-showbox img").eq(current).addClass("current").siblings().removeClass("current");
            showCurrent(current);
        });
    });
    $(document).on("click", ".close-showbox,.bg", function() {
        $(".m-showbox,.bg,.close-showbox").remove();
        $("body").css("overflow", "auto");
    });
}

// 切换视频和图片
$(".exhibitionlist .videobox .ritab li").each(function(){
    if($(this).hasClass("on")){
        var src=$(this).attr("data-url")
        $(".exhibitionlist .videobox .leftvideo iframe").attr("src",src)
    }
})
$(".exhibitionlist .videobox .ritab li").click(function(){
    $(this).addClass("on").siblings().removeClass("on");
    var src=$(this).attr("data-url")
    $(".exhibitionlist .videobox .leftvideo iframe").attr("src",src)
})



   // 订单列表的提示显示
   var layertips_
   $(".salelist .list ul li .infor .tab_box .tab ").on({
       mouseenter: function () {
           var tex = $(this).attr("data-text");
           layertips_=layer.tips(tex, this, { tips: [1, '#666666'], time: 0,   });
       },
       mouseleave: function () {
           layer.close(layertips_)
       }
   })
//导航固定定位；
   var arr_nav =[]
   $(".list .bt-h").each(function(){
       var i=$(this).offset().top;
       arr_nav.push(i)
   })
function flex_box() {
       var scrollTop = $(this).scrollTop();
       var iTop = $(window).scrollTop();//鼠标滚动的距离
           var k;
           var  left_=($(window).width()-1200)/2+130;
           if($(window).width()<=1200){
               left_=130;
           }
           if(scrollTop>=arr_nav[0]){
               for(var i=0;i<arr_nav.length;i++){
                   if(scrollTop>=arr_nav[i]){
                       k=i;
                   } 
               } 
           }else{
               $(".salelist .list").find(" .bt-h p").removeClass("on");
           }
           $(".salelist .list").eq(k).find(" .bt-h p").addClass("on").css("left",left_+'px');
           $(".salelist .list").eq(k).siblings().find(" .bt-h p").removeClass("on").css("left",0+'px');
}
// flex_box();
$(window).resize(function  ()  {
   flex_box();
});
$(window).scroll(function () {
   flex_box();

});



$(".Ritem7 .morelis").each(function(){
   $(this).find(".btn:gt(4)").hide();
})
$(".Ritem7 .morelis .more2").click(function(){
    $(this).hide();
    $(this).parents('.morelis').find(".btn").show();
})
